//
//  SHD_SearTingTabelCell.m
//  B段项目
//
//  Created by dllo on 15/11/11.
//  Copyright © 2015年 谢美娜. All rights reserved.
//

#import "SHD_SearTingTabelCell.h"

@implementation SHD_SearTingTabelCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _leftImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_leftImageView];
        _titleLabel = [[myTitleLabel alloc]init];
        [self.contentView addSubview:_titleLabel];
        _nameLabel = [[UILabel alloc]init];
        [self.contentView addSubview:_nameLabel];
        _rightImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_rightImageView];
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _leftImageView.frame = CGRectMake(15 * FitWidth, 15 * FitHeight, 40 * FitWidth, 40 * FitHeight);
    _titleLabel.frame  = CGRectMake(_leftImageView.frame.size.width + _leftImageView.frame.origin.x + 15 * FitWidth, FitHeight * 15, 200 * FitWidth, 20 *FitHeight);
    _nameLabel.frame = CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.origin.y + _titleLabel.frame.size.height, 100 * FitWidth, 12 * FitHeight);
    _nameLabel.textColor = [UIColor lightGrayColor];
    _nameLabel.font = [UIFont systemFontOfSize:10 * FitWidth];
    _rightImageView.frame = CGRectMake(344 * FitWidth, 27 * FitHeight, 16 * FitWidth, 16 * FitHeight);
    
}
-(void)setList:(SHD_SearchTingList *)list
{
    _list = list;
    [_leftImageView sd_setImageWithURL:[NSURL URLWithString:list.firstimage] placeholderImage:[UIImage imageNamed:@"占位"]];
    _titleLabel.text = list.title;
    _nameLabel.text = [NSString stringWithFormat:@"by : %@", [list.userinfo objectForKey:@"uname"]];
    _rightImageView.image = [UIImage imageNamed:@"SHD_右播放"];
}
@end
